package com.two.shopping.mapper;

import com.two.shopping.pojo.Commodity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//这是商城模块
@Mapper
public interface IShoppingCenterMapper {
    //根据ID查询
    @Select("select *from commodity where id=#{id}")
    Commodity idList(Integer id);


    //根据类型进行查询
    @Select("select * from commodity where commodity_type_id=#{commodityTypeId} and state=1")
    List<Commodity> commodityTypeIdList(Integer commodity);

    //全部查询
    @Select("select *from commodity where state=1")
    List<Commodity> allIdList();

    //根据商品ID进行查询
    @Select("select  *from commodity where commodity_type_id=#{id}")
    List<Commodity> listId(Integer id);

    //分页模糊查询
    List<Commodity> pageLike(String name, Float priceBegin, Float priceEnd);
    /**/
}
